package com.itheima.mp.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter
public enum UserStatus {
    NORMAL(1,"正常"),
    FREEZE(2,"冻结");
    @EnumValue // 枚举值映射数据库字段
    private Integer code;

    @JsonValue // 枚举值序列化时返回给前端
    private String message;
    UserStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
